﻿Imports System.Xml

Namespace Stories
	Public Class TextVariableInstance
		Inherits Child

		Public Property Self As String

		Public Property Name As String

		Public Property ResultText As String

		Public Property AssociatedTextVariable As String

		Shared Function ReadXml(reader As XmlReader) As TextVariableInstance
			Dim tv As New TextVariableInstance()

			If reader.HasAttributes() Then
				tv.Self = reader.GetAttribute("Self")
				tv.Name = reader.GetAttribute("Name")
				tv.ResultText = reader.GetAttribute("ResultText")
				tv.AssociatedTextVariable = reader.GetAttribute("AssociatedTextVariable")
			End If

			If Not reader.IsEmptyElement Then
				While reader.Read()
					Throw New NotImplementedException("Need to implement TextVariableInstance Properties")
					If reader.Name = "TextVariableInstance" And reader.NodeType = XmlNodeType.EndElement Then Exit While
				End While
			End If

			Return tv
		End Function

	End Class
End Namespace